local skel = fk.CreateSkill{
  name = "emo__luoxialy",
  tags = {Skill.Compulsory},
  dynamic_desc = function (self, player, lang)
    local x = player:getMark("emo__aidezy_count")
    local text = "emo__luoxialy_inner:"
    if x < 2 then
      text = text .. "emo__luoxialy1:"
    else
      text = text .. ":"
    end
    if x < 1 then
      text = text .. "emo__luoxialy2"
    end
    return text
  end,
}

Fk:loadTranslationTable{
  ["emo__luoxialy"] = "落霞烙印",
  [":emo__luoxialy"] = "锁定技，【桃】对你的效果仅为获得1点护甲。你受到伤害时，减1点体力上限并摸两张牌防止之。",

  [":emo__luoxialy_inner"] = "{1}{2}",
  ["emo__luoxialy1"] = "锁定技，【桃】对你的效果仅为获得1点护甲。",
  ["emo__luoxialy2"] = "你受到伤害时，减1点体力上限并摸两张牌防止之。",

  ["luoxialy__peach_skill"] = "落霞烙印",
  ["#luoxialy__peach_skill"] = "获得1点护甲",
}

skel:addEffect(fk.PreCardEffect,{
  anim_type = "negative",
  can_trigger = function(self, event, target, player, data)
    local x = player:getMark("emo__aidezy_count")
    return player:hasSkill(skel.name) and data.to == player and data.card.trueName == "peach" and x < 2
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    data:changeCardSkill("luoxialy__peach_skill")
  end,
})

skel:addEffect(fk.DamageInflicted,{
  anim_type = "defensive",
  can_trigger = function (self, event, target, player, data)
    local x = player:getMark("emo__aidezy_count")
    return target == player and player:hasSkill(skel.name) and x < 1
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    room:changeMaxHp(player, -1)
    player:drawCards(2, skel.name)
    data:preventDamage()
  end,
})

local luoxialy__peach = fk.CreateSkill{
  name = "luoxialy__peach_skill",
}

luoxialy__peach:addEffect("cardskill", {
  prompt = "#luoxialy__peach_skill",
  mod_target_filter = Util.TrueFunc,
  can_use = Util.CanUseToSelf,
  mute = true,
  on_effect = function(self, room, effect)
    if not effect.to.dead then
      room:changeShield(effect.to, 1)
    end
  end,
})

return {skel, luoxialy__peach}